﻿<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<f:loadBundle basename="properties.msg" var="p"/>

<ui:composition template="template.xhtml">

<ui:define name="title">
	<f:view>
		<title>Administration</title>
	</f:view>
</ui:define>
<ui:define name="body">
<f:view>
	<table rules = "all">
	<tr>
		<td valign="top">
			<h2><h:outputText value="Créer un client" /></h2>
			<h:form id="createClientForm">
				<table>	
				<tr>
					<td>			
						<h:outputText value="Nom :" />
					</td>
					<td>
						<h:inputText value="#{manager.clientTmp.nom}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Prénom :" />
					</td>
					<td>
						<h:inputText value="#{manager.clientTmp.prenom}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Téléphone :" />
					</td>
					<td>
						<h:inputText value="#{manager.clientTmp.telephone}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Mail :" />
					</td>
					<td>				
						<h:inputText value="#{manager.clientTmp.mail}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h4><h:outputText value="Adresse" /></h4>		
					</td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Pays :" />
					</td>
					<td>
						<h:inputText value="#{manager.adresseTmp.pays}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Ville :" />
					</td>
					<td>
						<h:inputText value="#{manager.adresseTmp.ville}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Rue :" />
					</td>
					<td>
						<h:inputText value="#{manager.adresseTmp.rue}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Code postal :" />
					</td>
					<td>
						<h:inputText value="#{manager.adresseTmp.code_postal}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h4><h:outputText value="Identification" /></h4>		
					</td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Identifiant :" />
					</td>
					<td>
						<h:inputText value="#{manager.clientTmp.login}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Mot de passe :" />
					</td>
					<td>
						<h:inputText value="#{manager.clientTmp.mot_de_passe}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h:commandButton action="#{manager.saveClient}" value="Créer" />
					</td>
				</tr>
				</table>
			</h:form>
			</td>
		</tr>
		<tr>	
			<td valign="top">
				<h2><h:outputText value="Créer un sport" /></h2>
				<h:form id="createSportForm">
				
				<table>
				<tr>
					<td>
						<h:outputText value="Nom :" />
					</td>
					<td>
						<h:inputText value="#{manager.sportTmp.nom}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td valign="top">
						<h:outputText value="Détail :" />
					</td>
					<td>
						<h:inputTextarea cols="20" rows="5" value="#{manager.sportTmp.detail}"  required = "true"/>
					</td>
				</tr>
				<tr>
					<td>
						<h:commandButton action="#{manager.saveSport}" value="Créer" />
					</td>
				</tr>
				</table>
				</h:form>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<h2><h:outputText value="Créer un voyage" /></h2>
				<table>
					<h:form id="createVoyageForm">
					<tr>
						<td>
							<h:outputText value="Date de départ :" />
						</td>
						<td>
			                <rich:calendar cellWidth="24px" cellHeight="22px" value="#{manager.voyageTmp.date_depart}" 
									style="width:200px" datePattern="dd/MM/yyyy" />
		                </td>
	                </tr>
					<tr>
						<td>
							<h:outputText value="Date de retour :" />
						</td>
						<td>
							 <rich:calendar cellWidth="24px" cellHeight="22px" value="#{manager.voyageTmp.date_retour}" 
									style="width:200px" datePattern="dd/MM/yyyy" />
		                </td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Ville de départ :" />
						</td>
						<td>
							<h:inputText value="#{manager.voyageTmp.ville_depart}"  required = "true"/>
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Destination :" />
						</td>
						<td>
							<h:inputText value="#{manager.voyageTmp.destination}"  required = "true"/>
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Prix :"  required = "true"/>
						</td>
						<td>
							<h:inputText value="#{manager.voyageTmp.prix}"  required = "true"/>
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Nombres de personnes :"  required = "true"/>
						</td>
						<td>
							<h:inputText value="#{manager.voyageTmp.nb_personnes}" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Id Sport :" />
						</td>
						<td>
							<h:inputText value="#{manager.voyageTmp.sport.id_sport}"  required = "true"/>
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Description :" />
						</td>
						<td>
							<h:inputText value="#{manager.voyageTmp.description}"  required = "true"/>
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Hébergement :" />
						</td>
						<td>
							<h:inputText value="#{manager.voyageTmp.hebergement}"  required = "true"/>
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Transport :" />
						</td>
						<td>
							<h:inputText value="#{manager.voyageTmp.transport}"  required = "true"/>
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Promotion :" />
						</td>
						<td>
							 <h:selectBooleanCheckbox value="#{manager.voyageTmp.promotion}" required = "true" />
						</td>
					</tr>
					<tr>
						<td>
							<h:commandButton action="#{manager.saveVoyage}" value="Créer" />
						</td>
					</tr>
					</h:form>
				</table>
				</td>
		</tr>
	</table>
	<h:messages style="color:red;"></h:messages>
</f:view>
</ui:define>
</ui:composition>
</html>